package com.sphd.beautysalon.presenter;


import com.android.volley.VolleyError;
import com.sphd.beautysalon.info.FoodInfo;
import com.sphd.beautysalon.model.OrderParticaularsModelImpl;
import com.sphd.beautysalon.view.OrderParticaularsView;

import java.util.List;

/**
 * Created by Hu on 2016/11/08
 */

public class OrderParticaularsPresenterImpl implements OrderParticaularsPresenter {
   OrderParticaularsModelImpl orderParticaularsModel;
    OrderParticaularsView orderParticaularsView;

    public OrderParticaularsPresenterImpl(OrderParticaularsView orderParticaularsView) {
        this.orderParticaularsView = orderParticaularsView;
        orderParticaularsModel=new OrderParticaularsModelImpl();
    }

    @Override
    public void addData(String url) {
        orderParticaularsView.showLoading();
            orderParticaularsModel.sendUrl(url,this);
    }

    @Override
    public void sendError(VolleyError error) {
        orderParticaularsView.dissLoading();
    }

    @Override
    public void sendRes(List<FoodInfo> foodInfoList) {
        orderParticaularsView.recRes(foodInfoList);
        orderParticaularsView.dissLoading();
    }
}